{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Wordprocessor usage example\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:46:47.106226Z",
     "iopub.status.busy": "2025-07-26T18:46:47.105226Z",
     "iopub.status.idle": "2025-07-26T18:47:09.278063Z",
     "shell.execute_reply": "2025-07-26T18:47:09.275193Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "!!!!\n",
      "DISCLAIMER: TinyTroupe relies on Artificial Intelligence (AI) models to generate content. \n",
      "The AI models are not perfect and may produce inappropriate or inacurate results. \n",
      "For any serious or consequential use, please review the generated content before using it.\n",
      "!!!!\n",
      "\n",
      "Looking for default config on: C:\\Users\\pdasilva\\repos\\TinyTroupe\\examples\\..\\tinytroupe\\utils\\..\\config.ini\n",
      "Found custom config on: C:\\Users\\pdasilva\\repos\\TinyTroupe\\examples\\config.ini\n",
      "TinyTroupe version: 0.5.1\n",
      "Current date and time (local): 2025-07-26 15:46:49\n",
      "Current date and time (UTC):   2025-07-26 18:46:49\n",
      "\n",
      "=================================\n",
      "Current TinyTroupe configuration \n",
      "=================================\n",
      "[OpenAI]\n",
      "api_type = openai\n",
      "azure_api_version = 2024-08-01-preview\n",
      "model = gpt-4.1-mini\n",
      "reasoning_model = o3-mini\n",
      "embedding_model = text-embedding-3-small\n",
      "max_tokens = 32000\n",
      "temperature = 1.5\n",
      "freq_penalty = 0.1\n",
      "presence_penalty = 0.1\n",
      "timeout = 480\n",
      "max_attempts = 5\n",
      "waiting_time = 0\n",
      "exponential_backoff_factor = 5\n",
      "reasoning_effort = high\n",
      "cache_api_calls = False\n",
      "cache_file_name = openai_api_cache.pickle\n",
      "max_content_display_length = 1024\n",
      "azure_embedding_model_api_version = 2023-05-15\n",
      "\n",
      "[Simulation]\n",
      "parallel_agent_generation = True\n",
      "parallel_agent_actions = True\n",
      "rai_harmful_content_prevention = True\n",
      "rai_copyright_infringement_prevention = True\n",
      "\n",
      "[Cognition]\n",
      "enable_memory_consolidation = True\n",
      "min_episode_length = 15\n",
      "max_episode_length = 50\n",
      "episodic_memory_fixed_prefix_length = 10\n",
      "episodic_memory_lookback_length = 20\n",
      "\n",
      "[ActionGenerator]\n",
      "max_attempts = 2\n",
      "enable_quality_checks = False\n",
      "enable_regeneration = True\n",
      "enable_direct_correction = False\n",
      "enable_quality_check_for_persona_adherence = True\n",
      "enable_quality_check_for_selfconsistency = False\n",
      "enable_quality_check_for_fluency = False\n",
      "enable_quality_check_for_suitability = False\n",
      "enable_quality_check_for_similarity = False\n",
      "continue_on_failure = True\n",
      "quality_threshold = 5\n",
      "\n",
      "[Logging]\n",
      "loglevel = ERROR\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "import sys\n",
    "import csv\n",
    "sys.path.insert(0, '..') # ensures that the package is imported from the parent directory, not the Python installation\n",
    "\n",
    "\n",
    "import tinytroupe\n",
    "from tinytroupe.openai_utils import force_api_type\n",
    "from tinytroupe.factory import TinyPersonFactory\n",
    "from tinytroupe.agent import TinyPerson, TinyToolUse\n",
    "from tinytroupe.environment import TinyWorld\n",
    "from tinytroupe import control\n",
    "from tinytroupe.extraction import ResultsExtractor, ResultsReducer\n",
    "from tinytroupe.enrichment import TinyEnricher\n",
    "from tinytroupe.extraction import ArtifactExporter\n",
    "from tinytroupe.tools import TinyWordProcessor\n",
    "from tinytroupe.steering import TinyStory\n",
    "import tinytroupe.utils as utils\n",
    "from tinytroupe.examples import create_lisa_the_data_scientist, create_oscar_the_architect, create_marcos_the_physician"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:47:09.288157Z",
     "iopub.status.busy": "2025-07-26T18:47:09.288157Z",
     "iopub.status.idle": "2025-07-26T18:47:09.307456Z",
     "shell.execute_reply": "2025-07-26T18:47:09.306281Z"
    }
   },
   "outputs": [],
   "source": [
    "data_export_folder = \"../data/extractions/wordprocessor\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:47:09.316567Z",
     "iopub.status.busy": "2025-07-26T18:47:09.315561Z",
     "iopub.status.idle": "2025-07-26T18:47:09.337817Z",
     "shell.execute_reply": "2025-07-26T18:47:09.336572Z"
    }
   },
   "outputs": [],
   "source": [
    "exporter = ArtifactExporter(base_output_folder=data_export_folder)\n",
    "enricher = TinyEnricher()\n",
    "tooluse_faculty = TinyToolUse(tools=[TinyWordProcessor(exporter=exporter, enricher=enricher)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:47:09.347427Z",
     "iopub.status.busy": "2025-07-26T18:47:09.346823Z",
     "iopub.status.idle": "2025-07-26T18:47:09.479041Z",
     "shell.execute_reply": "2025-07-26T18:47:09.477013Z"
    }
   },
   "outputs": [],
   "source": [
    "lisa = create_lisa_the_data_scientist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:47:09.487129Z",
     "iopub.status.busy": "2025-07-26T18:47:09.487129Z",
     "iopub.status.idle": "2025-07-26T18:47:09.510291Z",
     "shell.execute_reply": "2025-07-26T18:47:09.508272Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TinyPerson(name='Lisa Carter')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lisa.add_mental_faculties([tooluse_faculty])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:47:09.517369Z",
     "iopub.status.busy": "2025-07-26T18:47:09.517369Z",
     "iopub.status.idle": "2025-07-26T18:48:02.326572Z",
     "shell.execute_reply": "2025-07-26T18:48:02.322439Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic; text-decoration: underline\">USER</span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\"> --&gt; </span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic; text-decoration: underline\">Lisa Carter</span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\">: [CONVERSATION] </span>\n",
       "<span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\">          &gt; You have just been fired and need to find a new job. You decide to think about what you</span>\n",
       "<span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\">          &gt; want in life and then write a resume. Make it very detailed.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;3;4;38;5;51mUSER\u001b[0m\u001b[1;3;38;5;51m --> \u001b[0m\u001b[1;3;4;38;5;51mLisa Carter\u001b[0m\u001b[1;3;38;5;51m: \u001b[0m\u001b[1;3;38;5;51m[\u001b[0m\u001b[1;3;38;5;51mCONVERSATION\u001b[0m\u001b[1;3;38;5;51m]\u001b[0m\u001b[1;3;38;5;51m \u001b[0m\n",
       "\u001b[1;3;38;5;51m          > You have just been fired and need to find a new job. You decide to think about what you\u001b[0m\n",
       "\u001b[1;3;38;5;51m          > want in life and then write a resume. Make it very detailed.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: underline\">Lisa Carter</span><span style=\"color: #008000; text-decoration-color: #008000\"> acts: </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">[</span><span style=\"color: #008000; text-decoration-color: #008000\">THINK</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">]</span><span style=\"color: #008000; text-decoration-color: #008000\"> </span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; I need to carefully consider what I want in life after being fired. My long-term</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; goals include advancing AI technology to enhance human productivity and</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; maintaining a balanced personal and professional life. I should reflect on my</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; skills, experiences, and preferences to shape my resume accordingly. I want to</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; highlight my education, work experience at Microsoft, skills in Python, machine</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; learning, and data analysis, as well as my interests in AI and natural language</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; processing. I also want to emphasize my personality traits like curiosity,</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; analytical thinking, and collaboration. Once I have a clear idea of what to</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; include, I will write a detailed resume that reflects my professional background</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; and aspirations.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[4;32mLisa Carter\u001b[0m\u001b[32m acts: \u001b[0m\u001b[1;32m[\u001b[0m\u001b[32mTHINK\u001b[0m\u001b[1;32m]\u001b[0m\u001b[32m \u001b[0m\n",
       "\u001b[32m                 > I need to carefully consider what I want in life after being fired. My long-term\u001b[0m\n",
       "\u001b[32m                 > goals include advancing AI technology to enhance human productivity and\u001b[0m\n",
       "\u001b[32m                 > maintaining a balanced personal and professional life. I should reflect on my\u001b[0m\n",
       "\u001b[32m                 > skills, experiences, and preferences to shape my resume accordingly. I want to\u001b[0m\n",
       "\u001b[32m                 > highlight my education, work experience at Microsoft, skills in Python, machine\u001b[0m\n",
       "\u001b[32m                 > learning, and data analysis, as well as my interests in AI and natural language\u001b[0m\n",
       "\u001b[32m                 > processing. I also want to emphasize my personality traits like curiosity,\u001b[0m\n",
       "\u001b[32m                 > analytical thinking, and collaboration. Once I have a clear idea of what to\u001b[0m\n",
       "\u001b[32m                 > include, I will write a detailed resume that reflects my professional background\u001b[0m\n",
       "\u001b[32m                 > and aspirations.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #af00ff; text-decoration-color: #af00ff; text-decoration: underline\">Lisa Carter</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\"> acts: </span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">[</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">WRITE_DOCUMENT</span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">]</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\"> </span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; </span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">{</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\"title\"</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">: </span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\"Lisa Carter - Resume\"</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">,</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\"author\"</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">: </span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\"Lisa Carter\"</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">,</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\"content\"</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">: \"# Lisa</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Carter\\n\\n## Contact Information\\n- Location: USA\\n- Nationality: Canadian\\n-</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Email: </span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">[</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">Not provided</span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">]</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\\n- Phone: </span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">[</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">Not provided</span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">]</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">\\n\\n## Professional Summary\\nData</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Scientist with a Master's degree in Data Science from the University of Toronto,</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; specializing in improving search relevance using context-aware models.</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Experienced in analyzing user behavior and feedback data to enhance search</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; results quality. Skilled in building and testing machine learning models for</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; natural language understanding, query expansion, and ranking. Strong commitment</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; to accuracy, reliability, scalability, and ethical data use. Collaborative team</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; player with a passion for AI technology that enhances human productivity and</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; decision-making.\\n\\n## Education\\n- Master of Science in Data Science, University</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; of Toronto\\n  - Thesis: Improving search relevance using context-aware models\\n-</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Postgraduate internship at a tech startup focused on conversational AI\\n\\n## Work</span>\n",
       "<span style=\"color: #af00ff; text-decoration-color: #af00ff\">                 &gt; Expe </span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">(</span><span style=\"color: #af00ff; text-decoration-color: #af00ff\">...</span><span style=\"color: #af00ff; text-decoration-color: #af00ff; font-weight: bold\">)</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[4;38;5;129mLisa Carter\u001b[0m\u001b[38;5;129m acts: \u001b[0m\u001b[1;38;5;129m[\u001b[0m\u001b[38;5;129mWRITE_DOCUMENT\u001b[0m\u001b[1;38;5;129m]\u001b[0m\u001b[38;5;129m \u001b[0m\n",
       "\u001b[38;5;129m                 > \u001b[0m\u001b[1;38;5;129m{\u001b[0m\u001b[38;5;129m\"title\"\u001b[0m\u001b[38;5;129m: \u001b[0m\u001b[38;5;129m\"Lisa Carter - Resume\"\u001b[0m\u001b[38;5;129m,\u001b[0m\u001b[38;5;129m\"author\"\u001b[0m\u001b[38;5;129m: \u001b[0m\u001b[38;5;129m\"Lisa Carter\"\u001b[0m\u001b[38;5;129m,\u001b[0m\u001b[38;5;129m\"content\"\u001b[0m\u001b[38;5;129m: \"# Lisa\u001b[0m\n",
       "\u001b[38;5;129m                 > Carter\\n\\n## Contact Information\\n- Location: USA\\n- Nationality: Canadian\\n-\u001b[0m\n",
       "\u001b[38;5;129m                 > Email: \u001b[0m\u001b[1;38;5;129m[\u001b[0m\u001b[38;5;129mNot provided\u001b[0m\u001b[1;38;5;129m]\u001b[0m\u001b[38;5;129m\\n- Phone: \u001b[0m\u001b[1;38;5;129m[\u001b[0m\u001b[38;5;129mNot provided\u001b[0m\u001b[1;38;5;129m]\u001b[0m\u001b[38;5;129m\\n\\n## Professional Summary\\nData\u001b[0m\n",
       "\u001b[38;5;129m                 > Scientist with a Master's degree in Data Science from the University of Toronto,\u001b[0m\n",
       "\u001b[38;5;129m                 > specializing in improving search relevance using context-aware models.\u001b[0m\n",
       "\u001b[38;5;129m                 > Experienced in analyzing user behavior and feedback data to enhance search\u001b[0m\n",
       "\u001b[38;5;129m                 > results quality. Skilled in building and testing machine learning models for\u001b[0m\n",
       "\u001b[38;5;129m                 > natural language understanding, query expansion, and ranking. Strong commitment\u001b[0m\n",
       "\u001b[38;5;129m                 > to accuracy, reliability, scalability, and ethical data use. Collaborative team\u001b[0m\n",
       "\u001b[38;5;129m                 > player with a passion for AI technology that enhances human productivity and\u001b[0m\n",
       "\u001b[38;5;129m                 > decision-making.\\n\\n## Education\\n- Master of Science in Data Science, University\u001b[0m\n",
       "\u001b[38;5;129m                 > of Toronto\\n  - Thesis: Improving search relevance using context-aware models\\n-\u001b[0m\n",
       "\u001b[38;5;129m                 > Postgraduate internship at a tech startup focused on conversational AI\\n\\n## Work\u001b[0m\n",
       "\u001b[38;5;129m                 > Expe \u001b[0m\u001b[1;38;5;129m(\u001b[0m\u001b[38;5;129m...\u001b[0m\u001b[1;38;5;129m)\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold; text-decoration: underline\">Lisa Carter</span><span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\"> acts: [TALK] </span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; I've just finished drafting a detailed resume that highlights my education,</span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; skills, work experience at Microsoft, and my interests in AI and machine</span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; learning. It also reflects my personality traits like curiosity and</span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; collaboration. I'm ready to review it or share it if needed.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;4;38;5;40mLisa Carter\u001b[0m\u001b[1;38;5;40m acts: \u001b[0m\u001b[1;38;5;40m[\u001b[0m\u001b[1;38;5;40mTALK\u001b[0m\u001b[1;38;5;40m]\u001b[0m\u001b[1;38;5;40m \u001b[0m\n",
       "\u001b[1;38;5;40m                 > I've just finished drafting a detailed resume that highlights my education,\u001b[0m\n",
       "\u001b[1;38;5;40m                 > skills, work experience at Microsoft, and my interests in AI and machine\u001b[0m\n",
       "\u001b[1;38;5;40m                 > learning. It also reflects my personality traits like curiosity and\u001b[0m\n",
       "\u001b[1;38;5;40m                 > collaboration. I'm ready to review it or share it if needed.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; text-decoration: underline\">Lisa Carter</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\"> acts: </span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; font-weight: bold\">[</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\">DONE</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; font-weight: bold\">]</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\"> </span>\n",
       "\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[4;38;5;252mLisa Carter\u001b[0m\u001b[38;5;252m acts: \u001b[0m\u001b[1;38;5;252m[\u001b[0m\u001b[38;5;252mDONE\u001b[0m\u001b[1;38;5;252m]\u001b[0m\u001b[38;5;252m \u001b[0m\n",
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "lisa.listen_and_act(\"You have just been fired and need to find a new job. You decide to think about what you want in life and then write a resume. Make it very detailed.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-26T18:48:02.337572Z",
     "iopub.status.busy": "2025-07-26T18:48:02.336507Z",
     "iopub.status.idle": "2025-07-26T18:48:11.772897Z",
     "shell.execute_reply": "2025-07-26T18:48:11.771896Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic; text-decoration: underline\">USER</span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\"> --&gt; </span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic; text-decoration: underline\">Lisa Carter</span><span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\">: [CONVERSATION] </span>\n",
       "<span style=\"color: #00ffff; text-decoration-color: #00ffff; font-weight: bold; font-style: italic\">          &gt; What did I just told you?</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;3;4;38;5;51mUSER\u001b[0m\u001b[1;3;38;5;51m --> \u001b[0m\u001b[1;3;4;38;5;51mLisa Carter\u001b[0m\u001b[1;3;38;5;51m: \u001b[0m\u001b[1;3;38;5;51m[\u001b[0m\u001b[1;3;38;5;51mCONVERSATION\u001b[0m\u001b[1;3;38;5;51m]\u001b[0m\u001b[1;3;38;5;51m \u001b[0m\n",
       "\u001b[1;3;38;5;51m          > What did I just told you?\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000; text-decoration: underline\">Lisa Carter</span><span style=\"color: #008000; text-decoration-color: #008000\"> acts: </span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">[</span><span style=\"color: #008000; text-decoration-color: #008000\">THINK</span><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">]</span><span style=\"color: #008000; text-decoration-color: #008000\"> </span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; The user asked me what they just told me. They mentioned that I have just been</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; fired and need to find a new job, and that I should think about what I want in</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; life and then write a very detailed resume. I should respond clearly and</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">                 &gt; professionally, summarizing this information.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[4;32mLisa Carter\u001b[0m\u001b[32m acts: \u001b[0m\u001b[1;32m[\u001b[0m\u001b[32mTHINK\u001b[0m\u001b[1;32m]\u001b[0m\u001b[32m \u001b[0m\n",
       "\u001b[32m                 > The user asked me what they just told me. They mentioned that I have just been\u001b[0m\n",
       "\u001b[32m                 > fired and need to find a new job, and that I should think about what I want in\u001b[0m\n",
       "\u001b[32m                 > life and then write a very detailed resume. I should respond clearly and\u001b[0m\n",
       "\u001b[32m                 > professionally, summarizing this information.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold; text-decoration: underline\">Lisa Carter</span><span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\"> acts: [TALK] </span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; You told me that I have just been fired and need to find a new job. You asked me</span>\n",
       "<span style=\"color: #00d700; text-decoration-color: #00d700; font-weight: bold\">                 &gt; to think about what I want in life and then write a very detailed resume.</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;4;38;5;40mLisa Carter\u001b[0m\u001b[1;38;5;40m acts: \u001b[0m\u001b[1;38;5;40m[\u001b[0m\u001b[1;38;5;40mTALK\u001b[0m\u001b[1;38;5;40m]\u001b[0m\u001b[1;38;5;40m \u001b[0m\n",
       "\u001b[1;38;5;40m                 > You told me that I have just been fired and need to find a new job. You asked me\u001b[0m\n",
       "\u001b[1;38;5;40m                 > to think about what I want in life and then write a very detailed resume.\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"margin:0px;;white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; text-decoration: underline\">Lisa Carter</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\"> acts: </span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; font-weight: bold\">[</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\">DONE</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0; font-weight: bold\">]</span><span style=\"color: #d0d0d0; text-decoration-color: #d0d0d0\"> </span>\n",
       "\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[4;38;5;252mLisa Carter\u001b[0m\u001b[38;5;252m acts: \u001b[0m\u001b[1;38;5;252m[\u001b[0m\u001b[38;5;252mDONE\u001b[0m\u001b[1;38;5;252m]\u001b[0m\u001b[38;5;252m \u001b[0m\n",
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "lisa.listen_and_act(\"What did I just told you?\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py310",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
